CloudWatch Alarms
💡 Definition
CloudWatch Alarms allow you to watch a single CloudWatch metric over a time period and perform one or more actions based on the value of the metric relative to a threshold you define.
🔑 Key Concepts
- Threshold: The limit you set (e.g., CPU > 80%).
- States:
- OK: Within threshold.
- ALARM: Breached threshold.
- INSUFFICIENT_DATA: Not enough data to decide.
- Actions: What happens when the alarm changes state.
- Notification: Send an email/SMS via SNS.
- Auto Scaling: Trigger a scale-out or scale-in policy.
- EC2 Action: Stop, terminate, or recover an instance.
⚙️ How it Works
- Select Metric: Choose
CPUUtilizationfor an instance. - Define Condition: "Greater than 80% for 5 minutes".
- Configure Action: "Send email to Admin" AND "Add 1 instance to ASG".
🎯 Use Cases
- Alerting: Getting notified when your website is slow or down.
- Automation: Automatically scaling your infrastructure to meet demand.
- Remediation: Rebooting a stuck instance.
💰 Pricing Model
- Standard Resolution: Free tier includes 10 alarms. Paid per alarm per month thereafter.
- High Resolution: (10-second intervals) costs more.
📝 Exam Tips (CLF-C02)
- Alarms trigger actions based on metrics.
- Key integration with Auto Scaling and SNS (Simple Notification Service).
See Also: * CloudWatch * Auto Scaling * SNS